#ifndef APPLICATION_H
#define APPLICATION_H

#include <event/events.h>
#include <windows.h>

#include "controller.h"

#define OPTION_GRID 1

CREATE_EVENT_2(AppOptionEvent, APP_OPTION_EVENT, events::APP_QUEUE, long, option, long, value)

#define MOUSE_RIGHT 0x01
#define MOUSE_LEFT  0x02
#define MOUSE_UP    0x04
#define MOUSE_DOWN  0x08

CREATE_EVENT_3(MouseEvent, APP_MOUSE_EVENT, events::APP_QUEUE, float, x, float, y, unsigned long, button)

#define TOOL_VIEW 0x00

CREATE_EVENT_1(ToolEvent, APP_TOOL_EVENT, events::APP_QUEUE, unsigned long, tool)

CREATE_EVENT_5(ViewEvent, APP_VIEW_EVENT, events::APP_QUEUE, long, x, long, y, long, width, long, height, float, scale)

CREATE_EVENT_2(SetViewEvent, SET_VIEW_EVENT, events::MAIN_QUEUE, long, x, long, y)

//maybe this should all be some sort of class that gets inherited

DWORD WINAPI RunApplication(LPVOID window);

long HandleEvent(const events::Event * event, Controller & c);
long LoadResource(unsigned long type, const std::string & filename, Controller & c);
void SetLines();
void SetView();

#endif
